<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<base href="<%=basePath%>">
    <LINK rel="stylesheet" media="screen" type="text/css" title="Style" href="css/style.css">
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/simplemodal.js" type="text/javascript"></script>
	<title>Добавление студента</title>
</head>
<body>
	<div id="background_image">
        <div id="content">
        	<div id="header">
                <ul id="tabs">
                    <li id="interval_1">
                    </li>
                    <li id="houses">
                        <a href="houses">Факультеты</a>
                    </li>
                    <li id="interval_2">
                    </li>
                    <li id="professors">
                        <a href="professors">Профессоры</a>
                    </li>
                    <li id="interval_3">
                    </li>
                    <li id="students" class="current">
                        <a href="students">Студенты</a>
                    </li>
                    <li id="interval_4">
                    </li>
                    <li id="rating">
                        <a href="rating">Рейтинг</a>
                    </li>
                    <li id="interval_5">
                    </li>
                    <li id="subjects">
                        <a href="subjects">Дисциплины</a>
                    </li>
                    <li id="interval_6">
                    </li>
                    <c:if test="${userRole == 3 || userRole == 0}">
	                    <li id="rooms">
	                        <a href="rooms">Общежитие</a>
	                    </li>
                    </c:if>
                    <c:if test="${userRole == 1 || userRole == 2 || userRole == 4 || userRole == 5}">
                    	<li id="blank">
	                    </li>
                    </c:if>
                    <li id="interval_7">
                    </li>
                </ul>
                <div id="message">
                    
                </div>
            </div>
            <div id="book">
                <div id="left_page">
                    <div id="title_left_page">
                        <img src="img/coat_of_arms.png" alt="Coat of Arms of Hogwarts" />
                        <h5>
                            Академия Чародейства и
                            <br />
                            Волшебства "Хогвартс"
                        </h5>
                    </div>
                    <c:if test="${error != \"\"}">
                        <div id="error">
                        	<h2><span>С</span>ледующие поля введены неверно:</h2>
                        	<h4>
                        		${error}
                        	</h4>
                        </div>
                    </c:if>
                    <div id="user">
                        <div class="welcome">
                            <h2>
                                <span>Д</span>обро пожаловать,
                                <p class="userName">
                                	${userFN} ${userLN}
                                </p>
                            </h2>
                        </div>
                        <div class="profile">
                            <h4>
								<c:if test="${userRole == 5 && choiceTime==true}">
		                            <a href="choice"><span>В</span>ыбор дисиплин</a>
		                            <br />
	                            </c:if>
								<c:if test="${userRole <= 2 && expulsionTime==true}">
		                            <a href="expulsion"><span>С</span>туденты на отчисление</a>
		                            <br />
	                            </c:if>
                                <a href="messages"><span>С</span>ообщения (${countMess})</a>
                                <br />
                                <c:if test="${userRole < 5}">
	                                <a href="professors/edit?id=${userID}"><span>Р</span>едактировать</a>
	                                <br />
                                </c:if>
                                <a href="#change_password"><span>С</span>менить пароль</a>
                                <br />
                                <a href="logout"><span>В</span>ыход</a>
                            </h4>
                        </div>
                    </div>
                </div>
                <div id="right_page">
                    <div id="title_right_page">
                        <img src="img/coat_of_arms.png" alt="Coat of Arms of Hogwarts" />
                        <h3><span>С</span>туденты</h3>
                    </div>
                    <div id="list">
                    <div id="hat">
                        <div class="title">
                            <h2><span>Д</span>обавление студента</h2>
                        </div>
                        <form name="add" action="students/add" method="post">
                        	<div class="field">
	                            <h2><span>И</span>мя:</h2>
	                            <input type="text" name="firstName" id="first_name_form" class="form_text" value="${firstName}" />
	                        </div>
	                        <div class="field">
	                            <h2><span>Ф</span>амилия:</h2>
	                            <input type="text" name="lastName" id="last_name_form" class="form_text" value="${lastName}" />
	                        </div>
                            <div class="field">
	                            <h2><span>К</span>урс:</h2>
	                            <select name="year" id="year_form" class="form_text">
			   						<option selected value=""></option>
			   							
	                                <c:if test="${year == 1}"><option value="1" selected>1</option></c:if>
					   				<c:if test="${year != 1}"><option value="1">1</option></c:if>
					   							
					   				<c:if test="${year == 2}"><option value="2" selected>2</option></c:if>
					   				<c:if test="${year != 2}"><option value="2">2</option></c:if>
					   							
					   				<c:if test="${year == 3}"><option value="3" selected>3</option></c:if>
					   				<c:if test="${year != 3}"><option value="3">3</option></c:if>
					   							
					   				<c:if test="${year == 4}"><option value="4" selected>4</option></c:if>
					   				<c:if test="${year != 4}"><option value="4">4</option></c:if>
					   							
					   				<c:if test="${year == 5}"><option value="5" selected>5</option></c:if>
					   				<c:if test="${year != 5}"><option value="5">5</option></c:if>
					   							
					   				<c:if test="${year == 6}"><option value="6" selected>6</option></c:if>
					   				<c:if test="${year != 6}"><option value="6">6</option></c:if>
	                            </select>
                            </div>
                            <div class="field">
	                            <h2><span>С</span>татус:</h2>
	                            <select id="status_form" name="status" class="form_text">
	                            	<option selected value=""></option>
					   				
									<c:if test="${status == 'обучается'}"><option value="обучается" selected>обучается</option></c:if>
					   				<c:if test="${status != 'обучается'}"><option value="обучается">обучается</option></c:if>
					   				
					   				<c:if test="${status == 'обучен'}"><option value="обучен" selected>обучен</option></c:if>
					   				<c:if test="${status != 'обучен'}"><option value="обучен">обучен</option></c:if>
					   				
					   				<c:if test="${status == 'отчислен'}"><option value="отчислен" selected>отчислен</option></c:if>
					   				<c:if test="${status != 'отчислен'}"><option value="отчислен">отчислен</option></c:if>
		   						</select>
                            </div>
                            <div class="field_date">
	                            <h2><span>Д</span>ата зачисления:</h2>
	                            <select id="begin_form" name="beginDD" size="1" class="form_text">
	                            	<option selected value=""></option>
									
									<c:forEach items="${dd}" var="dd">
										<c:if test="${dd == begin.date}"><option selected value="${dd}">${dd}</option></c:if>
					   					<c:if test="${dd != begin.date}"><option value="${dd}">${dd}</option></c:if>
		   							</c:forEach>
		   						</select>
		   						<select id="begin_form" name="beginMM" size="1" class="form_text">
		   							<option selected value=""></option>
		   							
		   							<c:if test="${00 == begin.month}"><option selected value="01">январь</option></c:if>
					   				<c:if test="${00 != begin.month}"><option value="01">январь</option></c:if>
					   				
					   				<c:if test="${01 == begin.month}"><option selected value="02">февраль</option></c:if>
					   				<c:if test="${01 != begin.month}"><option value="02">февраль</option></c:if>
					   			
					   				<c:if test="${02 == begin.month}"><option selected value="03">март</option></c:if>
					   				<c:if test="${02 != begin.month}"><option value="03">март</option></c:if>
					   				
					   				<c:if test="${03 == begin.month}"><option selected value="04">апрель</option></c:if>
					   				<c:if test="${03 != begin.month}"><option value="04">апрель</option></c:if>
					   				
					   				<c:if test="${04 == begin.month}"><option selected value="05">май</option></c:if>
					   				<c:if test="${04 != begin.month}"><option value="05">май</option></c:if>
					   				
					   				<c:if test="${05 == begin.month}"><option selected value="06">июнь</option></c:if>
					   				<c:if test="${05 != begin.month}"><option value="06">июнь</option></c:if>
					   				
					   				<c:if test="${06 == begin.month}"><option selected value="07">июль</option></c:if>
					   				<c:if test="${06 != begin.month}"><option value="07">июль</option></c:if>
					   				
					   				<c:if test="${07 == begin.month}"><option selected value="08">август</option></c:if>
					   				<c:if test="${07 != begin.month}"><option value="08">август</option></c:if>
					   				
					   				<c:if test="${08 == begin.month}"><option selected value="09">сентябрь</option></c:if>
					   				<c:if test="${08 != begin.month}"><option value="09">сентябрь</option></c:if>
					   				
					   				<c:if test="${09 == begin.month}"><option selected value="10">октябрь</option></c:if>
					   				<c:if test="${09 != begin.month}"><option value="10">октябрь</option></c:if>
					   				
					   				<c:if test="${10 == begin.month}"><option selected value="11">ноябрь</option></c:if>
					   				<c:if test="${10 != begin.month}"><option value="11">ноябрь</option></c:if>
					   				
					   				<c:if test="${11 == begin.month}"><option selected value="12">декабрь</option></c:if>
					   				<c:if test="${11 != begin.month}"><option value="12">декабрь</option></c:if>
		   						</select>
		   						<select id="begin_form" name="beginYYYY" class="form_text">
		   							<option selected value=""></option>
		   												   				
		   							<c:forEach items="${yyyy}" var="yyyy">
										<c:if test="${yyyy-1900 == begin.year}"><option selected value="${yyyy}">${yyyy}</option></c:if>
					   					<c:if test="${yyyy-1900 != begin.year}"><option value="${yyyy}">${yyyy}</option></c:if>
		   							</c:forEach>
		   						</select>
                            </div>
                            <div class="field_date">
	                            <h2><span>Д</span>ата окончания:</h2>
	                            <select id="end_form" name="endDD" size="1" class="form_text">
	                            	<option selected value=""></option>
					   				
									<c:forEach items="${dd}" var="dd">
										<c:if test="${dd == end.date}"><option selected value="${dd}">${dd}</option></c:if>
					   					<c:if test="${dd != end.date}"><option value="${dd}">${dd}</option></c:if>
		   							</c:forEach>
		   						</select>
		   						<select id="end_form" name="endMM" size="1" class="form_text">
		   							<option selected value=""></option>
					   				
		   							<c:if test="${00 == end.month}"><option selected value="01">январь</option></c:if>
					   				<c:if test="${00 != end.month}"><option value="01">январь</option></c:if>
					   				
					   				<c:if test="${01 == end.month}"><option selected value="02">февраль</option></c:if>
					   				<c:if test="${01 != end.month}"><option value="02">февраль</option></c:if>
					   				
					   				<c:if test="${02 == end.month}"><option selected value="03">март</option></c:if>
					   				<c:if test="${02 != end.month}"><option value="03">март</option></c:if>
					   				
					   				<c:if test="${03 == end.month}"><option selected value="04">апрель</option></c:if>
					   				<c:if test="${03 != end.month}"><option value="04">апрель</option></c:if>
					   			
					   				<c:if test="${04 == end.month}"><option selected value="05">май</option></c:if>
					   				<c:if test="${04 != end.month}"><option value="05">май</option></c:if>
					   			
					   				<c:if test="${05 == end.month}"><option selected value="06">июнь</option></c:if>
					   				<c:if test="${05 != end.month}"><option value="06">июнь</option></c:if>
					   			
					   				<c:if test="${06 == end.month}"><option selected value="07">июль</option></c:if>
					   				<c:if test="${06 != end.month}"><option value="07">июль</option></c:if>
					   				
					   				<c:if test="${07 == end.month}"><option selected value="08">август</option></c:if>
					   				<c:if test="${07 != end.month}"><option value="08">август</option></c:if>
					   				
					   				<c:if test="${09 == end.month}"><option selected value="09">сентябрь</option></c:if>
					   				<c:if test="${08 != end.month}"><option value="09">сентябрь</option></c:if>
					   				
					   				<c:if test="${09 == end.month}"><option selected value="10">октябрь</option></c:if>
					   				<c:if test="${09 != end.month}"><option value="10">октябрь</option></c:if>
					   				
					   				<c:if test="${10 == end.month}"><option selected value="11">ноябрь</option></c:if>
					   				<c:if test="${10 != end.month}"><option value="11">ноябрь</option></c:if>
					   				
					   				<c:if test="${11 == end.month}"><option selected value="12">декабрь</option></c:if>
					   				<c:if test="${11 != end.month}"><option value="12">декабрь</option></c:if>
		   						</select>
		   						<select id="end_form" name="endYYYY" class="form_text">
		   							<option selected value=""></option>
					   				
		   							<c:forEach items="${yyyy}" var="yyyy">
		   								<c:if test="${yyyy-1900 == end.year}"><option selected value="${yyyy}">${yyyy}</option></c:if>
					   					<c:if test="${yyyy-1900 != end.year}"><option value="${yyyy}">${yyyy}</option></c:if>
		   							</c:forEach>
		   						</select>
                            </div>
                            <div class="field hat">
                            <h2><span>Х</span>рабрость:</h2>
	                         <select id="end_form" name="hat" size="1" class="form_text">
	                            <option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select><br>
		   					</div>
		   					<div class="field hat">
                            <h2><span>Б</span>лагородство:</h2>
	                        <select id="end_form" name="hat" size="1" class="form_text">
	                          	<option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select><br>
		   					</div>
		   					<div class="field hat">
		   					<h2><span>Т</span>ворчество:</h2>
	                        <select id="end_form" name="hat" size="1" class="form_text">
	                           	<option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select><br>
		   					</div>
		   					<div class="field hat">
		   					<h2><span>М</span>удрость:</h2>
	                        <select id="end_form" name="hat" size="1" class="form_text">
	                           	<option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select><br>
		   					</div>
		   					<div class="field hat">
		   					<h2><span>Т</span>удолюбие:</h2>
	                        <select id="end_form" name="hat" size="1" class="form_text">
	                           	<option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select><br>
		   					</div>
		   					<div class="field hat">
		   					<h2><span>Ч</span>естность:</h2>
	                        <select id="end_form" name="hat" size="1" class="form_text">
	                           	<option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select><br>
		   					</div>
		   					<div class="field hat">
		   					<h2><span>Н</span>аходчивость:</h2>
	                        <select id="end_form" name="hat" size="1" class="form_text">
	                           	<option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select><br>
		   					</div>
		   					<div class="field hat">
		   					<h2><span>А</span>мбициозность:</h2>
	                        <select id="end_form" name="hat" size="1" class="form_text">
	                           	<option selected value=""></option>
								<option value="1">Низкий</option>
					   			<option value="2">Ниже среднего</option>
					   			<option value="3">Средний</option>
					   			<option value="4">Выше среднего</option>
					   			<option value="5">Высокий</option>
		   					</select>
		   					</div>					
                            <div class="buttons">
                            	<span class="reset">
                            		<a class="form_button" href="students">Отмена</a>
                            	</span>
                                <span class="submit"><input class="form_button" type="submit" name="btnSave" value="Сохранить" /></span>
                            </div>
                        </form>
                    </div>
                    </div>
                </div>
            </div>
            <div id="footer">
                <h1>
                    © 2010 Hogwarts. All rights reserved
                    <br />
                    Powered by SMC
                </h1>
            </div>
        </div>
    </div>
    <c:if test="${countMess != 0}">
	    <script type="text/javascript">
	    var temp="<div><img src='img/owl.png' alt=''style='float:left'><h3><a href='messages/info?id="
		    +${unreadedMess}+"'> <span>В</span>ам пришло новое сообщение!</a></h3></div>";
	        $.modal(temp);
	    </script>
	</c:if>
</body>
</html>